//
//  systemInfo.m
//  HappyStore
//
//  Created by 李小辉 on 16/10/20.
//  Copyright © 2016年 LLJ. All rights reserved.
//

#import "systemInfo.h"
#import "mainMyCell.h"
#import "addNewFriend.h"
#import "informationNotificationTVC.h"
@interface systemInfo ()

@end

@implementation systemInfo

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"系统消息";
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:19.0f],NSFontAttributeName,[UIColor whiteColor],NSForegroundColorAttributeName, nil]];
    //去掉自定义cell底部的黑线
    self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;
    self.tableView.bounces = NO;
    //设置返回按钮
    UIBarButtonItem *leftItem = [UIBarButtonItem itemWithTarget:self action:@selector(leftBarButtonItemClick) image:@"Back" highImage:@"Back"];
    self.navigationItem.leftBarButtonItem = leftItem;
    self.tabBarController.tabBar.hidden = YES;
    
}
- (void)leftBarButtonItemClick{
    [self.navigationController popViewControllerAnimated:YES];
}


#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPat{
    return 53;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    mainMyCell *cell = [[mainMyCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"reuseIdentifier"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
    if (indexPath.section == 0) {
        cell.textLabel.text = @"好友邀请";
    }else{
        cell.textLabel.text = @"消息通知";
        
    }
    
    return cell;
}


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{

    return 10;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (indexPath.section == 0) {
        addNewFriend * addNewFri = [[addNewFriend alloc]init];
        [self.navigationController pushViewController:addNewFri animated:YES];
    }else{
        informationNotificationTVC *notiVC = [[informationNotificationTVC alloc] init];
        [self.navigationController pushViewController:notiVC animated:YES];
    }
}

@end
